#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>


void Swap(char* buff1, char* buff2, size_t  width)
{
	int i = 0;
	char tmp = 0; 
	for (i = 0; i < width; i++)
	{
		tmp = *buff1; 
		*buff1 = *buff2;
		*buff2 = tmp;
		buff1++;
		buff2++;

	}

 }

int  Cmp_int(const void* p1, const void* p2)
{
	return   *(int*)p1 - *(int*)p2;

}
void Bubble_Sort(void* base, size_t sz, size_t width, int (*cmp)(const void* p1, const void* p2))
{
	int i = 0;
	for (i = 0; i < sz - 1; i++)
	{
		for (int j = 0; j < sz - 1 - i; j++)
		{
			if (cmp((char*) base + j * width, (char*)base + (j + 1) * width) > 0)
			{

				Swap((char*)base + j * width, (char*)base + (j + 1) * width,width);
			}

		}


	 }
}
void Print(int arr[], int sz)
{
	int i = 0; 
	for (i = 0; i < sz; i++)
	{
		printf("%d ", arr[i]);

	}
}
  int main1() 
{
	
		int arr[10] = { 1,2,5,4,3,7,6,9,8,10 };
		int sz = sizeof(arr) / sizeof(arr[0]);
		Bubble_Sort(arr, sz, sizeof(arr[0]), Cmp_int );
		Print(arr,sz );
			return 0;

}

  int main()
  {




	  return 0; 
}